CSE 5520 Homework 1

Student Lynn Pepin ('Tristan Pepin')
tmp13009 / 2079724
Due date 2021 / Sept / 7

This is Lynn Pepin's report for CSE 5520 homework 1. It is organized with code first, and then the microlab.

1. Hands-on Microlab

Let's create an interactive chart using pygal.

The file lynnkit will hold all the helper-functions and whatnot I use in this course. When the code is provided or trivial (e.g. a fibonacci generator), I don't include it in the notebook.

1.1 Plotting with PyGal

1.2. Plotting with Plotly

1.3 Host a graph with Dash

This is a tool by the makers of Plotly that provides a server for visualization in the browser.

2. Screenshots of running code

2.1. Pygal

PyGal screenshot of two SVGs, with Fibonacci sequence values from 1 to 10, and from 1 to 50.

image.png

2.2. Plotly

As above, so below, for Plotly

image.png

image.png

2.3. Dash

As above, so below, published in-browser using Dash.

image.png

Addendum: Code from lynnkit

I put extra code into lynnkit. I wrote a Fibonacci generator, which I am very proud of, so I have copied the pertinent code here.

def fibgen():
    """Provides a generator yielding the fibonacci sequence

    :yields: int
    :returns: An iterator which yields the i-th value of the Fibonacci sequence
        for each i-th call of next() on an instance of fibgen
    :rtype: Iterator[int]

    >>> f = fibgen()
    >>> next(f)
    0
    >>> next(f)
    1
    >>> next(f)
    1
    >>> next(f)
    2
    >>> next(f)
    3
    """

    vals = [0, 1]
    ii = 0
    while True:
        yield vals[ii%2]
        vals[ii%2] += vals[(ii+1)%2]
        ii += 1